<!DOCTYPE html>
<html>
<head>
    <title>csap apidoc</title>
    <meta charset="utf-8"/>
    <link rel="icon" href="images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<div id="loadDiv" style="font-size: 12px;left: 50%;position: fixed;top: 50%;"><img src="images/5-150331205502.gif"/>
</div>
<div id="app" hidden="true">
    <div class="m-header">
        <a href="#" style="display: inherit;">
            <img class="logo" src="images/favicon.ico" alt="">
        </a>
        <a href="#"><h1 class="title">{{apiInfo.title}}</h1></a>
        <div class="nav">
            <label>搜索</label>
            <input name="value" v-model="searchValue" style="height: 30px;width: 150px" type="search"
                   v-on:input="search">
            <label>其他服务API</label>
            <select name="cars" @change="changeApi">
                <option value="">请选择</option>
                <option :value="resource.url" :i="resource" v-for="(resource,index) in resources">{{resource.name}}
                </option>
            </select>
            <label>分组</label>
            <select name="cars" @change="searchGroupApi">
                <option value="">请选择</option>
                <option :value="group" v-for="(group,index) in groups">{{group}}</option>
            </select>
            <label>版本</label>
            <select name="cars" @change="searchVersionApi">
                <option value="">请选择</option>
                <option :value="version" v-for="(version,index) in versions">{{version}}</option>
            </select>
            <a href="#">csap-apidoc</a>

        </div>
    </div>
    <div class="g-doc">
        <div class="table-of-contents">
            <ul class="nav-ul" type="api-class-left">
                <li type="api-class-list" v-for="api in apiList"
                    v-if="(group=='default' || api.group.indexOf(group)!=-1)
                    && (version=='default' || api.version.indexOf(version)!=-1)
                    && (searchValue.length==0 || api.search.indexOf(searchValue)!=-1)
                    ">
                    <div>
                        <div class="title-open" onclick="showApiList(this)">
                            <img src="../images/d.png" type="d">
                            <img src="../images/o.png" type="o" style="display: none">
                            <a class="nav-a api-left-title" type="api" :href="'#'+api.name">
                                {{api.value}}
                            </a>
                        </div>
                        <ul type="api-class-method" style="display: none">
                            <li type="api-class-method-list" v-for="method in api.methodList"
                                v-if="(group=='default' || method.group.indexOf(group)!=-1)
                                && (version=='default' || method.version.indexOf(version)!=-1)
                                && ((searchValue.length==0 || method.search.indexOf(searchValue)!=-1))
                                ">
                                <a class="nav-a splitStr" :href="'#'+api.name+'.'+method.name">{{method.value}}</a></li>
                        </ul>
                    </div>
                </li>
            </ul>
        </div>
        <div id="right" class="content-right">
            <!-- 头部-->
            <h1 class="curproject-name"> {{apiInfo.title}} </h1>
            <div>
                <div>描述:<span>{{apiInfo.description}}</span></div>
                <div>版本:<span>{{version}}</span></div>
                <div>分组:<span>{{group}}</span></div>
                <div>请求路径:<span>{{url()}}</span></div>
            </div>
            <!--  class 部分-->
            <div type="api-class-right" v-for="(api,ai) in apiList"
                 v-if="(group=='default' || api.group.indexOf(group)!=-1)
                 && (version=='default' || api.version.indexOf(version)!=-1)
                 && (searchValue.length==0 || api.search.indexOf(searchValue)!=-1)">
                <!--最外层class层-->
                <div type="api-class-list">
                    <h1 class="api-title" key="className" :id="api.name">{{api.value}}</h1>
                </div>
                <!--接口基本信息-->
                <div type="api-class-method-detail" v-for="(method,mi) in api.methodList"
                     v-if="(group=='default' || method.group.indexOf(group)!=-1)
                     && (version=='default' || method.version.indexOf(version)!=-1)
                     && (searchValue.length==0 || method.search.indexOf(searchValue)!=-1)
                    "
                     :func="mareModelField(method)"
                >
                    <!-- 方法基本信息-->
                    <div type="method-info">
                        <!--  方法标题-->
                        <h2 type="title"
                            class="api-title"
                            :id="api.name+'.'+method.name">
                            {{method.value}}
                        </h2>
                        <p></p>
                        <!-- 方法基本信息-->
                        <div>
                            <h3 id="-9">基本信息</h3>
                            <p><strong>Path：</strong>
                                <span v-if="api.path!=null" key="path" v-for="path in api.path">
                                <span v-for="path2 in method.paths">
                                {{'/'+path+'/'+path2}}
                             </span>
                            </span>
                                <span v-if="api.path==null" v-for="path2 in method.paths">
                                {{'/'+path2}}
                             </span>
                            </p>
                            <p><strong>Method：</strong> <span key="method">{{method.methods.toString()}}</span></p>
                            <p><strong>分组：</strong><span key="description">{{method.group.toString()}}</span></p>
                            <p><strong>版本：</strong><span key="description">{{method.version.toString()}}</span></p>
                            <p><strong>接口描述：</strong><span key="description">{{method.description}}</span></p>
                        </div>
                    </div>
                    <!-- 方法参数和头部文件-->
                    <div type="api-class-method-params">
                        <h3 id="-10">请求参数</h3>
                        <p><strong>Headers</strong></p>
                        <table>
                            <thead>
                            <tr>
                                <th>参数名称</th>
                                <th>参数值</th>
                                <th>是否必须</th>
                                <th>示例</th>
                                <th>备注</th>
                            </tr>
                            </thead>
                            <tbody>
                            <!--头部文件数据-->
                            <tr type="headers" v-for="header in method.methodHeaders">
                                <td>{{header.key}}</td>
                                <td>{{header.value}}</td>
                                <td>{{header.required ? "是":"否"}}</td>
                                <td>{{header.example}}</td>
                                <td>{{header.description}}</td>
                            </tr>
                            </tbody>
                        </table>

                        <p v-if="method.paramTypes.indexOf('QUERY')!=-1"><strong>Query</strong></p>
                        <!--   请求参数-->
                        <table v-if="method.paramTypes.indexOf('QUERY')!=-1" type="request"
                               v-for="(request,ri) in method.request"
                               v-if="request.parameters!=null && request.parameters.length>0"
                               :name="api.name+method.name+request.name">
                            <thead>
                            <tr v-if="request.parameters!=null && request.parameters.length>0">
                                <th key=name>参数名称</th>
                                <th key=type>数据类型</th>
                                <th key=required>是否必须</th>
                                <th key=default>默认值</th>
                                <th key=example>示例</th>
                                <th key=desc>备注</th>
                                <th key=sub>描述</th>
                                <th key=group>分组</th>
                                <th key=version>版本</th>
                            </tr>
                            </thead>
                            <tbody v-html="getResponseParams(request.parameters,0,'')">
                            </tbody>
                        </table>

                        <p v-if="method.paramTypes.indexOf('BODY')!=-1"><strong>Body</strong></p>
                        <!--   请求参数-->
                        <table v-if="method.paramTypes.indexOf('BODY')!=-1" type="request"
                               v-for="(request,ri) in method.request"
                               v-if="request.parameters!=null && request.parameters.length>0"
                               :name="api.name+method.name+request.name"
                        >
                            <thead>
                            <tr v-if="request.parameters!=null && request.parameters.length>0">
                                <th key=name>参数名称</th>
                                <th key=type>数据类型</th>
                                <th key=required>是否必须</th>
                                <th key=default>默认值</th>
                                <th key=example>示例</th>
                                <th key=desc>备注</th>
                                <th key=sub>描述</th>
                                <th key=group>分组</th>
                                <th key=version>版本</th>
                            </tr>
                            </thead>
                            <tbody v-html="getResponseParams(request.parameters,0,'')">
                            </tbody>
                        </table>

                        <p v-if="method.paramTypes.indexOf('PATH')!=-1"><strong>Path</strong></p>
                        <!--   请求参数-->
                        <table v-if="method.paramTypes.indexOf('PATH')!=-1" type="request"
                               v-for="(request,ri) in method.request"
                               v-if="request.parameters!=null && request.parameters.length>0"
                               :name="api.name+method.name+request.name"
                               :fun="getModelName(api,method,request)">
                            <thead>
                            <tr v-if="request.parameters!=null && request.parameters.length>0">
                                <th key=name>参数名称</th>
                                <th key=type>数据类型</th>
                                <th key=required>是否必须</th>
                                <th key=default>默认值</th>
                                <th key=example>示例</th>
                                <th key=desc>备注</th>
                                <th key=sub>描述</th>
                                <th key=group>分组</th>
                                <th key=version>版本</th>
                            </tr>
                            </thead>
                            <tbody v-html="getResponseParams(request.parameters,0,'')">
                            </tbody>
                        </table>

                        <p v-if="method.paramTypes.indexOf('FORM_DATA')!=-1"><strong>Form_Data</strong></p>
                        <!--   请求参数-->
                        <table v-if="method.paramTypes.indexOf('FORM_DATA')!=-1" type="request"
                               v-for="(request,ri) in method.request"
                               v-if="request.parameters!=null && request.parameters.length>0"
                               :name="api.name+method.name+request.name"
                               :fun="getModelName(api,method,request)">
                            <thead>
                            <tr v-if="request.parameters!=null && request.parameters.length>0">
                                <th key=name>参数名称</th>
                                <th key=type>数据类型</th>
                                <th key=required>是否必须</th>
                                <th key=default>默认值</th>
                                <th key=example>示例</th>
                                <th key=desc>备注</th>
                                <th key=sub>描述</th>
                                <th key=group>分组</th>
                                <th key=version>版本</th>
                            </tr>
                            </thead>
                            <tbody v-html="getResponseParams(request.parameters,0,'')">
                            </tbody>
                        </table>
                    </div>
                    <!-- 返回的数据-->
                    <div type="response">
                        <h3 id="-11">返回数据</h3>
                        <table>
                            <thead class="ant-table-thead">
                            <tr>
                                <th key=name>参数名称</th>
                                <th key=type>数据类型</th>
                                <th key=required>是否必须</th>
                                <th key=default>默认值</th>
                                <th key=example>示例</th>
                                <th key=desc>备注</th>
                                <th key=sub>描述</th>
                                <th key=group>分组</th>
                                <th key=version>版本</th>
                            </tr>
                            </thead>
                            <tbody type="response-params" className="ant-table-tbody"
                                   v-html="getResponseParams(method.response==null || method.response.length==0 ? null : method.response[0].parameters,0,'')">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://lib.baomitu.com/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="js/doc.js"></script>
<script type="text/javascript">
    function showApiList(t) {
        $(t.nextElementSibling).toggle(200, function (i) {
            if ($(this).attr("style").indexOf("none") != -1) {
                this.previousElementSibling.querySelector("img[type='d']").style = "display: block;";
                this.previousElementSibling.querySelector("img[type='o']").style = "display: none;";
            } else {
                this.previousElementSibling.querySelector("img[type='o']").style = "display: block;";
                this.previousElementSibling.querySelector("img[type='d']").style = "display: none;";
            }
        });
    }
</script>
</body>
</html>
